package com.atguigu.spring6iocxml.di;

import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestBook {

    @Test
    public void testBook() {
        ApplicationContext context = new ClassPathXmlApplicationContext("beanDi.xml");
        Book book = context.getBean("book", Book.class);
        System.out.println(book.toString());
    }

    @Test
    public void testBookConstructor() {
        ApplicationContext context = new ClassPathXmlApplicationContext("beanDi.xml");
        Book book2 = context.getBean("book2", Book.class);
        System.out.println(book2.toString());
    }
}
